#ifndef CHARACTERCLASSTABLEMODEL_H
#define CHARACTERCLASSTABLEMODEL_H


#include "dtwenty_global.h"
#include "characterclass.h"


#include <QAbstractTableModel>
#include <QPointer>


class DTWENTYSHARED_EXPORT CharacterClassTableModel : public QAbstractTableModel
{
    Q_OBJECT
public:

    enum Column
    {
        Column_FIRST = 0,

        Column_LEVEL = Column_FIRST,
        Column_BA,
        Column_FORT,
        Column_REF,
        Column_WILL,
        Column_SPEC,

        Column_LAST = Column_SPEC
    };


    CharacterClassTableModel(QObject *parent = 0);

    void setCharacterClass(CharacterClass* root);

    virtual int rowCount(const QModelIndex &parent) const;
    virtual int columnCount(const QModelIndex &parent) const;

    virtual QVariant data(const QModelIndex &index, int role) const;
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;


public slots:

    virtual void revert();


protected:

    QPointer<CharacterClass> m_root;
};

#endif // CHARACTERCLASSTABLEMODEL_H
